<%@ page language="java" pageEncoding="UTF-8" %>
<%@ page import="${basepackage}.${projectName}.web.admin.constant.Uri" %>
<%@ include file="/WEB-INF/view/common/_common_prefix.jsp" %>
<div class="bjui-pageContent">
    <c:choose>
    <c:when test="${r'${'}empty entity or empty entity.${table.idColumn.columnNameFirstLower}}">
    <form action="${r'${root}'}<%=Uri.${table.sqlNameUpperCase}_ADD_SUBMIT%>" data-toggle="validate"
          data-reload-navtab="true" method="post">
        </c:when>
        <c:otherwise>
        <form action="${r'${root}'}<%=Uri.${table.sqlNameUpperCase}_UPDATE_SUBMIT%>" data-toggle="validate"
              data-reload-navtab="true" method="post">
            <input type="hidden" name="${table.idColumn.columnNameFirstLower}"
                   value="${'${'}entity.${table.idColumn.columnNameFirstLower}}">
            </c:otherwise>
            </c:choose>
            <div class="pageFormContent" data-layout-h="0">
                <table class="table-hover hw-table-long-input" width="100%">
                    <tbody>
                    <#list table.columns as column>
                        <#if column.columnNameFirstLower != 'id'>
                            <tr>
                                <td align="right">
                                    <label class="control-label"
                                           for="${table.sqlNameLowerCase}_${column.columnNameFirstLower}">${column.columnAlias}<span
                                            class="required">*</span>：</label>
                                </td>
                                <td>
                                    <#if column.javaType?index_of("Date")!=-1>
                                        <input type="text" id="${table.sqlNameLowerCase}_${column.columnNameFirstLower}"
                                               name="${column.columnNameFirstLower}"
                                               data-toggle="datepicker" placeholder="请输入时间"
                                               data-pattern="yyyy-MM-dd HH:mm:ss" readonly="readonly"
                                               value="<hs:datefmt value="${r'${'}item.${column.columnNameFirstLower}}" type="dateTimeSecPattern"/>"/>
                                        <#elseif column.columnNameFirstLower == 'sort'>
                                            <input type="text"
                                                   id="${table.sqlNameLowerCase}_${column.columnNameFirstLower}"
                                                   name="${column.columnNameFirstLower}" data-rule="required;sort"
                                                   maxlength="6" placeholder="请输入排序号，1~999999 的整数"/>
                                            <#else>
                                                <input type="text"
                                                       id="${table.sqlNameLowerCase}_${column.columnNameFirstLower}"
                                                       name="${column.columnNameFirstLower}" data-rule="required"
                                                       maxlength="20"
                                                       value="${'${'}entity.${column.columnNameFirstLower}}"
                                                       placeholder="请输入${column.columnAlias}"/>
                                    </#if>
                                </td>
                            </tr>
                        </#if>
                    </#list>
                    </tbody>
                </table>
            </div>
        </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <%--<li><a href="${r'${root}'}<%=Uri.${table.sqlNameUpperCase}_PAGE_SHOW%>" class="btn btn-red" data-toggle="navtab" data-id="navtab">取消</a></li>--%>
        <li>
            <button type="button" class="btn-close" data-icon="close">取消</button>
        </li>
        <li>
            <button type="submit" class="btn-default" data-icon="save">保存</button>
        </li>
    </ul>
</div>